package com.smh.a07ApIDemo7;

import java.io.IOException;

public class Test1 {
    public static void main(String[] args) {

        System.out.println(Runtime.getRuntime());
        //退出虚拟机
        //Runtime.getRuntime().exit(0);
        //是system.exit(0);的底层源码
        //cpu线程数
        System.out.println(Runtime.getRuntime().availableProcessors());
        //最大拥有的内存
        System.out.println(Runtime.getRuntime().maxMemory()/1024/1024);
        //已用的
        System.out.println(Runtime.getRuntime().totalMemory()/1024/1024);
        //还有的
        System.out.println(Runtime.getRuntime().freeMemory()/1024/1024);
        //cmd
        try {
            Runtime.getRuntime().exec("notepad");
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

    }
}
